<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- <link rel="icon" href="../../favicon.ico"> -->

    <title>企业管理</title>

    <!-- Bootstrap core CSS -->
    <link href="./libs/bootstarp/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> -->

    <!-- Custom styles for this template -->
    <link href="./css/index.css" rel="stylesheet">
    <link rel="stylesheet" href="./css/enterprise.css">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> -->

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- <script src="./libs//template/template-web.js"></script> -->
    <style>
        [v-cloak] {
            display: none !important;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <zdy-nav title="企业管理" :nav-list="navList"></zdy-nav>

        <div class="container">
            <div class="row enterprise-main">
                <div class="col-md-12">
                    <div class="enter-job">
                        <div class="col-md-12">
                            <h3>简历库</h3>
                            <div class="list-group">
                                <div class="lit-group-item zdy-group-item" v-for="item in resumes"
                                    @click="handleOnClickResume(item)">
                                    <div class="header">
                                        <p class="title">{{item.name}}</p>
                                        <p>{{item.shcool}}</p>
                                    </div>
                                    <div class="desc">
                                        <span>{{item.createTime}}</span>
                                        <span>{{item.major}}</span>
                                        <span>{{item.history}}</span>
                                    </div>
                                </div>
                            </div>
                            <zdy-page :total="resumeSize" @num="handleOnChangeResume"></zdy-page>
                        </div>
                    </div>
                </div>
            </div><!-- /.row -->
        </div><!-- /.container -->

        <zdy-footer></zdy-footer>
        <div id="myModal" class="modal fade" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">简历详情</h4>
                    </div>
                    <div class="modal-body">
                        <h4>姓名{{modalOptions.name}}</h4>
                        <p>专业：{{modalOptions.major}}</p>
                        <p>毕业学校：{{modalOptions.shcool}}</p>
                        <p>创建时间：{{modalOptions.createTime}}</p>
                        <p>个人经历：{{modalOptions.history}}</p>
                        <p>意向岗位：{{modalOptions.intention}}</p>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> -->
    <!-- <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script> -->
    <script src="./libs/jquery/jquery.min.js"></script>
    <script src="./libs/bootstarp/js/bootstrap.js"></script>
    <script src="./libs/vue/vue.js"></script>
    <script src="./tpl/publicTpl.js"></script>
    <script src="./js/utils.js"></script>
    <script src="./js/xhr.js"></script>

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <!-- <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script> -->
    <script>
        var vm = new Vue({
            el: '#app',
            data() {
                return {
                    navList: [
                        { text: '首页', value: '0', path: './enterprise.html' },
                        { text: '简历库', value: 'active', path: './resume.html' },
                        { text: '公司编辑', value: '2', path: './editor.html' },
                        { text: '发布职位', value: '3', path: './addJob.html' }
                    ],
                    titleShow: true,
                    descShow: true,
                    options: {
                        compId: '',
                        logo: '',
                        name: '',
                        info: '',
                        scale: '',
                        address: '',
                        comment: ''
                    },
                    jobs: [],
                    resumeList: [],
                    resumes: [],
                    modalOptions: {}
                }
            },
            computed: {
                resumeSize() {
                    return Math.ceil(this.resumeList.length / 10);
                }
            },
            created() {
                var self = this;
                var type = getSession('type');
                if (type == 0) {
                    window.location.replace('./index.html')
                }
                var comp = auth();
                if (comp) {
                    xhr.send('/pub/iface/job/getUsers', {}, function (res) {
                        self.resumeList = res.users;
                        self.resumes = res.users.slice(0, 10);
                    })
                }
            },
            methods: {
                handleOnChangeResume: function (num) {
                    var end = this.resumeList.slice(num).length > 10 ? 10 : null;
                    this.resumes = !!end ? this.resumeList.slice(num, end) : this.resumeList.slice(num)
                },
                handleOnClickResume: function (item) {
                    this.modalOptions = item;
                    $('#myModal').modal('show')
                }
            },
        })
    </script>
</body>

</html>